import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/mes-admin/shift-group/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getDetail = (id) => {
  return request({
    url: '/api/mes-admin/shift-group/detail',
    method: 'get',
    params: {
      id
    }
  });
};

export const remove = (ids) => {
  return request({
    url: '/api/mes-admin/shift-group/remove',
    method: 'get',
    params: {
      ids
    }
  });
};

export const add = (row) => {
  return request({
    url: '/api/mes-admin/shift-group/submit',
    method: 'post',
    data: row
  });
};

export const update = (row) => {
  return request({
    url: '/api/mes-admin/shift-group/submit',
    method: 'post',
    data: row
  });
};

// 班组人员 分页
export const getGroupList = (current, size, params) => {
  return request({
    url: '/api/mes-admin/shift-group-user/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};
// 班组人员 删除
export const groupRemove = (ids) => {
  return request({
    url: '/api/mes-admin/shift-group-user/remove',
    method: 'get',
    params: {
      ids
    }
  });
};

// 班组人员 新增/修改
export const groupSubmit = (row) => {
  return request({
    url: '/api/mes-admin/shift-group-user/submit',
    method: 'post',
    data: row
  });
};
